package recipie.core;

import java.util.HashMap;

public class IngredientCollection 
{
	private HashMap<String,Ingredient> ingredients;
	
	public IngredientCollection(){
		ingredients = new HashMap<String,Ingredient>() ;
	}
	
	public void addIngredient(Ingredient i){
		if(!ingredients.containsKey(i.getName())) 
			ingredients.put(i.getName(), i);
	}
	
	public boolean containsIngredient(Ingredient i){
		if(ingredients.containsKey(i.getName())) return true;
		return false;
	}
	
	public void removeIngredient(String ing){
	    if(ingredients.containsKey(ing))
	        ingredients.remove(ing);
    }
	
	public HashMap<String,Ingredient> getIngredients(){
		return ingredients;
	}
}
